<html>
	<head>
		<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
		<applet name="app" code="calcFee.class" width=10 height=10></applet>
		<script type="text/javascript">
			function hello(){
				app.changeStr();
				var sum = document.getElementById("test");
				sum.innerHTML = "<br/> test1: <br/>" + app.Hello() + "<br/>";
			}
			
			function get_number(){
				app.loadData();
				var sum = document.getElementById("num");
				sum.innerHTML = "<br/> Number of Parking Lots = " + app.getN() + "<br/>";
			}

			var MarkersArray = [];
			var Coordinates= [];
			var travelPathArray = [];
			var map;
			
			var marker = new google.maps.Marker();
			var destination = new google.maps.Marker();

			var directionDisplay;
			var directionsService = new google.maps.DirectionsService();
			var service = new google.maps.DistanceMatrixService();
			
			// S : http://google-maps-icons.googlecode.com/files/blueS.png
			// D : http://google-maps-icons.googlecode.com/files/blueD.png
			var sicon = new google.maps.MarkerImage("http://google-maps-icons.googlecode.com/files/blueS.png");
			var dicon = new google.maps.MarkerImage("http://google-maps-icons.googlecode.com/files/blueD.png");
			
			function initialize() {
				// load map
				directionDisplay = new google.maps.DirectionsRenderer();
				
				var myLatlng = new google.maps.LatLng(43.072681,-89.40146);
				var myOptions = {
					zoom: 16,
					center: myLatlng,
					mapTypeId: google.maps.MapTypeId.ROADMAP
				}
			
				map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
				directionDisplay.setMap(map);
				
				google.maps.event.addListener(map, 'click', function(event){
					marker.setMap(null);
					marker = new google.maps.Marker({
						position: event.latLng,
						map: map,
						title: 'location marker'
					});
					
					//attachMessage(marker, event.latLng);
					// save coordinates to draw line
					//Coordinates.push({location:event.latLng, stopover:true});
					// save marker
					//MarkersArray.push(marker);
				});				
			}
			
			/*function setAllMap(map) {
		        for (var i = 0; i < markers.length; i++) {
		          markers[i].setMap(map);
		        }
			}*/
			
			function set_dest() {
				destination = new google.maps.Marker({
					position: marker.getLatLng(),
					map: map,
					title: 'destination marker'
				});
				marker.setMap(null);
				marker = new google.maps.Marker();
				//destination.setMap(map);
				
				var sum = document.getElementById("dest_info");
				sum.innerHTML = "<br/> Destination is  . <br/>";
			}
		</script>
	</head>
	<body onload = "initialize()">
		<div id="map_canvas" style="width:800px; height:600px;"></div>
		<div id="control_panel">
			<input type="submit" onclick="hello();" />
		</div>
		<div id="test"></div>
		<div id="load_n">
			<input type="submit" title="Get Number" onclick="get_number();" />
		</div>
		<div id="num"></div>
		
		<div id="control_panel">
			<input type="submit" onclick="set_dest();" />
		</div>
		<div id="dest_info"></div>
	</body>
</html>